package com.wwy.monitor.common;

import java.io.Serializable;
import java.util.List;

public class PageResult implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = -5369832397069903247L;
    /**
     * 每页大小，默认10
     */
    private int pageSize = 10;
    /**
     * 当前页
     */
    private int currentPage = 1;
    /**
     * 总记录数
     */
    private int totalCount = 0;
    /**
     * 总页数
     */
    private int pages;

    private List<?> datas;

    public List<?> getDatas() {
        return datas;
    }

    public void setDatas(List<?> datas) {
        this.datas = datas;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getPages() {
        if (this.totalCount <= 0) {
            return 0;
        }
        if (this.totalCount % this.pageSize == 0) {
            this.pages = this.totalCount / this.pageSize;
        } else {
            this.pages = this.totalCount / this.pageSize + 1;
        }
        return pages;
    }

    public void setPages(int pages) {
        this.pages = pages;
    }


}
